package com.sdgakj.web.person;

import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

/**
 * Created by win10 on 2017/5/27.
 *  PersonDetail关系详情  已失效不在使用此表 5.27 17.03
 */
@Controller
@RequestMapping(value = "/personDetail")
public class PersonDetialController {
    private static Logger logger = LoggerFactory.getLogger(PersonDetialController.class);
    private static final String PAGE_SIZE = "10";

    /**
     * 添加亲属
     * @param li 父母|兄弟姐妹|子女
     * @param id 用户id
     * @param lastname 姓
     * @param fristname 名
     * @param gender 性别
     * @param alive 是否在世
     * @param bornTime 生日
     * @param tel 电话
     * @param wechat 微信
     * */
    @RequestMapping(value = "/addFamily",method = RequestMethod.POST)
    public JSONObject addFamily(@RequestParam(value = "li",required = true) String li,
                                @RequestParam(value = "id",required = true) Integer id,
                                @RequestParam(value = "lastname",required = true) String lastname,
                                @RequestParam(value = "fristname",required = true) String fristname,
                                @RequestParam(value = "gender",required = true) String gender,
                                @RequestParam(value = "alive",required = true) String alive,
                                @RequestParam(value = "bornTime",required = true) Date bornTime,
                                @RequestParam(value = "tel",required = true) String tel,
                                @RequestParam(value = "wechat",required = false) String wechat){
        JSONObject request=new JSONObject();
        /*
        * 1.获取添加亲属的信息
        * 2.获取User信息指id（是否验证父母的个数）
        * 3.给personDetile添加亲属信息，
        * */
        String name=lastname+fristname;

        try {

        }catch (Exception e){

        }
        return request;
    }
}
